init-xenstore-domain: cleanup all resources on a single exit path
authorIan Campbell <ian.campbell@citrix.com>
Wed, 10 Feb 2016 16:56:22 +0000 (16:56 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 11 Feb 2016 15:36:15 +0000 (15:36 +0000)
commitf15348afe976d3c5e17fce2d2beb412bbae7475b
tree5b8acb33c46b72f02821ce03b28e076dfd2bfb19
parent8b00908c114b0546e12cd1a0076b5af622c6bc08
init-xenstore-domain: cleanup all resources on a single exit path

Previously xs_fd would be left open, which is CID 1055993 (previously
partially fixed by 3bca826aae5eb).

Instead arrange for both success and error cases to cleanup everything
on a single exit path instead of doing partial cleanup on the success
path a few operations higher up.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/helpers/init-xenstore-domain.c